import path from 'path'
import {readJson} from '../util/PromiseJson.js'
import __dirname from '../util/dirname.js'
function src(dir){
  return path.join(__dirname ,'../data',dir )
}



const getAllMapTile = async (req,res)=>{
  const baseurl = 'http://localhost:9600'
  const data = await readJson(src('mapTileDatas.json')) 
  data.forEach(tile => {
          tile.src = baseurl + tile.src
  });
  res.send(data)
}

export {getAllMapTile}